<!doctype html>
<html class="no-js">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Amaze UI Admin form Examples</title>
<meta name="description" content="这是一个form页面">
<meta name="keywords" content="form">
<link rel="stylesheet" href="${ctxPath}/layui/css/layui.css">
<style type="text/css">
</style>
<% include("/common/inc/_css.html"){} %>
<link rel="stylesheet" type="text/css"
	href="${ctxPath}/assets/webuploader/webuploader.css">

</head>
<body>
	<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->
	<% include("/common/inc/_header.html"){} %>
	<div class="am-cf admin-main">
		<!-- sidebar start -->
		<% include("/common/inc/_menu.html"){} %>
		<!-- sidebar end -->
		<!-- content start -->
		<div class="admin-content">
			<div class="admin-content-body">
				<div class="am-cf am-padding am-padding-bottom-0">
					<div class="am-fl am-cf">
						<strong class="am-text-primary am-text-lg">产品类别添加页面</strong>
					</div>
				</div>
				<hr>
				<form class="am-form" method="post" id="doc-vld-msg">
				<fieldset>
				<div class="am-g am-margin-top-sm">
							<div class="am-u-sm-4 am-u-md-2 am-text-right">类别名称</div>
							<div class="am-u-sm-8 am-u-md-4 am-u-end">
								<input type="text" name="typeName" id="doc-vld-name"
									minlength="2"
									class="am-input-sm"/>
							</div>
							</div>
							<div class="am-g am-margin-top-sm">
							<div class="am-u-sm-4 am-u-md-2 am-text-right">类别介绍</div>
							<div class="am-u-sm-8 am-u-md-4 am-u-end">
							<fieldset id="field">
									<p>
										<textarea rows="5" id="intro" name="typeInfo"></textarea>
									</p>
								</fieldset>
							</div>
							</div>
							<div class="am-margin">
							<button id="btnTypeSave"
								class="am-btn am-btn-primary am-btn-xs btn-loading-example"
								data-am-loading="{spinner: 'circle-o-notch', loadingText: '提交中...', resetText: '提交保存'}">
								立即提交</button>
							<button type="button" class="am-btn am-btn-primary am-btn-xs">重置</button>
						</div>
				</fieldset>
				</form>
			</div>
			<footer class="admin-content-footer">
				<hr>
				<p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed
					under MIT license.</p>
			</footer>
		</div>
		<!-- content end -->
	</div>
	<a href="#"
		class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu"
		data-am-offcanvas="{target: '#admin-offcanvas'}"></a>
	<footer>
		<hr>
		<p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under
			MIT license.</p>
	</footer>
	<% include("/common/inc/_js.html"){} %>
	<script type="text/javascript"
		src="${ctxPath}/assets/webuploader/webuploader.js"></script>
	<script src="${ctxPath}/assets/laydate/laydate.js"></script>
	<!-- 改成你的路径 -->
	<!-- ajax提交表单 -->
	<script src="${ctxPath}/assets/js/jquery.form.min.js"></script>
	<script src="${ctxPath}/assets/layui/layui.js"></script>
	<script type="text/javascript">
	$(function(){
		$("#btnTypeSave").click(function(){
			$(".am-form").ajaxSubmit({
				success : function(data){
					if(data.errorCode!="0"){
						alert(data.errorMsg);
						return false;
						}
				window.location.href="${ctxPath}/product/listType"; 
				}
			})
			return false;
		})
	}); 
	
	</script>
</body>
</html>
